package com.muapet.service;

import java.util.List;

import com.muapet.model.Pet;
import com.muapet.model.Variety;
import com.muapet.model.other.Pagination;
import com.muapet.model.other.PetCondition;

public interface IPetService {

	Pet findById(Integer id);
	
	List<Pet> findAllPet(Pagination pagination);

	Integer countAllPet();

	/**
	 * 根据条件查找宠物列表
	 * 
	 * @param conditions
	 * @return
	 */
	List<Pet> listPetByConditions(PetCondition conditions);

	Integer countPetByConditions(PetCondition conditions);

	/**
	 * 查找最新上架的宠物
	 * 
	 * @return
	 */
	List<Pet> listNewestPet();

	/**
	 * 查找宠物品种
	 * 
	 * @param type
	 *            宠物类别
	 * @return
	 */
	List<Variety> listVarietysByType(Integer type);

	Integer updateVariety(Variety variety);

	Integer addVariety(Variety variety);

	Boolean checkVariety(String name);

	Integer deleteVariety(Integer id);

	Variety findVarietyById(Integer id);

	/**
	 * 按发布人和宠物出售在售查找宠物，不进行分页了，数据不多
	 * 
	 * @param sellerId
	 * @param state
	 *            :null/0:全选；1：未出售；2：已卖出/交易中
	 * @return
	 */
	List<Pet> listPetBySeller(Integer sellerId, Integer state);

	Integer update(Pet pet);

	Integer add(Pet pet);

	Integer delete(Integer id);

}
